package com
{
	import flash.events.MouseEvent;
	
	import mx.controls.Button;
	import mx.controls.Label;
	import mx.controls.TileList;
	
	public class testClass
	{
		public var myData:String;
		public var myTileListData:TileList;
		public var myLabelData:Label;
		public var myDataVar:Array;
		
		public function testClass(myBtn:Button,myTileList:TileList,myTileList2:TileList,myLabel:Label):void
		{
		 	//myTileList
		 	myTileList.dataProvider = ['cool','ok','marche','bien','Go','Test'];
		 	myTileList.columnWidth = 50;
		 	myTileList.addEventListener(MouseEvent.CLICK,viewData);
		 	
		 	//Bouton 
		 	//myBtn.label = 'mon Bouton';
			myBtn.addEventListener(MouseEvent.CLICK,onCLick);
			
			//myTileList2
			//myTileList2.dataProvider = [];
			myTileListData = myTileList2;
		 	myTileList2.addEventListener(MouseEvent.CLICK,onCLick);
		 	
		 	myLabelData = myLabel;
		}
		
		private function viewData(evt:MouseEvent):void
		{
			myData = evt.currentTarget.value as String;
		
			//trace(myData);
			myTileListData.dataProvider = [myData];
			//myDataVar = [];
			myDataVar = [myData];
		}


		private function onCLick(evt:MouseEvent,myDataVar:Array):void
		{
			trace(myDataVar);
		}

	}
}